<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: 徐康章曼舞
  Date: 2024/11/18
  Time: 19:40
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<style>
    table {
        border-collapse: collapse; /* 合并边框 */
        width: 800px; /* 设置表格宽度 */
    }
    th, td {
        border: 1px solid black; /* 设置边框 */
        padding: 0; /* 设置内边距 */
        align: center; /* 设置水平居中 */
    }
</style>
<body>
<a href="addbrand.html">
    <input type="button" value="新增">
</a>
<br>
<hr>

<table>
    <tr>
        <th>编号</th>
        <th>品牌名称</th>
        <th>企业名称</th>
        <th>排序</th>
        <th>品牌介绍</th>
        <th>状态</th>
        <th>操作</th>
    </tr>
<c:forEach items="${brands}" var="brand" varStatus="status">
    <tr >
        <td>${status.count}</td>
        <td>${brand.brandName}</td>
        <td>${brand.companyName}</td>
        <td>${brand.ordered}</td>
        <td>${brand.description}</td>
        <c:if test="${brand.status == 1}">
            <td>正常</td>
        </c:if>
        <c:if test="${brand.status == 0}">
            <td>停用</td>
        </c:if>
    <td><a href="/brand_demo/SelectByIdServlet?id=${brand.id}">修改   </a> <a href="/brand_demo/DeleteByIdServlet?id=${brand.id}">   删除</a></td>
    </tr>
</c:forEach>
</table>
<a href="/brand_demo/index.html">返回主页</a>
</body>
</html>